﻿using DAL_EF;


namespace BLL
{
    public class SaveManager
    {
        /// <summary>
        /// create new item into Course
        /// </summary>
        /// <param name="course"></param>
        public int addCourse(Model.Course course)
        {
            Factory factory = new Factory();
            ISaveRepository saveRepository = factory.saveOperations();
            int courseID = saveRepository.insertCourse(course);
            return courseID;
        }
        /// <summary>
        /// update course
        /// </summary>
        /// <param name="course"></param>
        public void updateCourse(Model.Course course)
        {
            Factory factory = new Factory();
            ISaveRepository saveRepository = factory.saveOperations();
            saveRepository.updateCourse(course);
        }
     
        /// <summary>
        /// insert new item into CourseDetails 
        /// </summary>
        /// <param name="coursedetails"></param>
        public void addCourseDetails(Model.CourseDetails coursedetails)
        {
            Factory factory = new Factory();
            ISaveRepository saveRepository = factory.saveOperations();
            saveRepository.insertCourseDetails(coursedetails);
        }
       
        public void removeCourseDetails(int couseId)
        {
            Factory factory = new Factory();
            ISaveRepository saveRepository = factory.saveOperations();
            saveRepository.deleteCourseDetails(couseId);
        }
       
    }
}
